
using CSharpPro._1028.service;

namespace CSharpPro._1028.impl;
public class UserServiceImpl : IUserService
{
    
    private List<User> list = new List<User>();
    
    public void Login(User user)
    {
        foreach (var i in list)
        {
            if (i.UserName == user.UserName && i.Password == user.Password)
            {
                Console.WriteLine("登陆成功");
                return;
            }
        }
        Console.WriteLine("账号或密码错误");
    }

    public void Register(User user)
    {
        list.Add(user);
        Console.WriteLine("注册成功");
    }
    
}